﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sui.Domain
{
    public class IEntity<TEntity>
    {
        public void Create()
        {
            var entity = this as ICreationAudited;
            entity.id =Guid.NewGuid().ToString();
            entity.creator_time = DateTime.Now;
        }
        public void Modify(string keyValue)
        {
            var entity = this as IModificationAudited;
            entity.id = keyValue;
            entity.modify_time = DateTime.Now;
        }
        public void Remove()
        {
            var entity = this as IDeleteAudited;
            entity.delete_time = DateTime.Now;
            entity.delete_mark = true;
        }
    }
}
